package com.ycfmedical.bed.factory;

import com.ycfmedical.bed.Constants;
import com.ycfmedical.bed.ControlBedConstants;

/**
 * Created by Administrator on 2017/3/17 0017.
 */

public class OrderFactory {
    /**
     * 消息工厂方法 底层返回未校验参数指令
     * 注意：此处获取的参数指令未校验
     */
    public static String getMessage(int TAG)
    {
        //请求（发送）携带自身硬件地址号bedId，接收携带单片机ID（ZGBID）
        switch (TAG)
        {
            // 请求 开机平板向单片机发送硬件地址请求指令()
            case ControlBedConstants.REQUEST_ZGB_MACADDRESS:
                return "ABBCCD"+ Constants.zgbId+"00010000000000000000000000000000000000";
            // 接收 单片机的硬件地址应答指令表示连接成功
            case ControlBedConstants.RECEIVE_ZGB_MACADDRESS:
                return "ABBCCD"+ Constants.bedId+"A0010200000000000000000000000000000000";
            // 请求当前床体传感器角度值的指令
            case ControlBedConstants.REQUEST_BED_ANGLE:
                return "ABBCCD"+ Constants.zgbId+"00220000000000000000000000000000000000";
            // 接收当前床体传感器角度值的指令
            case ControlBedConstants.RECEIVE_BED_ANGLE:
                return "ABBCCD"+ Constants.bedId+"A0220320090B00000000000800000000000000";



            // 发送睡眠体位指令
            case ControlBedConstants.CONTROL_POST_SLEEP:
                return "ABBCCD"+ Constants.zgbId+"00031A00000000000000000000000000000000";
            case ControlBedConstants.RETURN_POST_SLEEP:
                return "ABBCCD"+ Constants.bedId+"00031A00000000000000000000000000000000";

            // 发送休闲体位指令
            case ControlBedConstants.CONTROL_POST_RELAXATION:
                return "ABBCCD"+ Constants.zgbId+"00032B0F000000000014000000000000000000";
            case ControlBedConstants.RETURN_POST_RELAXATION:
                return "ABBCCD"+ Constants.bedId+"00032B0F00000000000F000000000000000000";

            // 发送就餐体位
            case ControlBedConstants.CONTROL_POST_REPAST:
                return "ABBCCD"+ Constants.zgbId+"00033C2D000000000000000000000000000000";
            case ControlBedConstants.RETURN_POST_REPAST:
                return "ABBCCD"+ Constants.bedId+"00033C1E00000000001E000000000000000000";

            // 发送工作体位
            case ControlBedConstants.CONTROL_POST_WORK:
                return "ABBCCD"+ Constants.zgbId+"00034D2400000000000A000000000000000000";
            case ControlBedConstants.RETURN_POST_WORK:
                return "ABBCCD"+ Constants.bedId+"00034D2D000000-00002D000000000000000000";

            // 发送CPR急救体位指令
            case ControlBedConstants.CONTROL_POST_CRP:
                return "ABBCCD"+ Constants.zgbId+"00400000000000000000000000000000000000";
            case ControlBedConstants.RETURN_POST_CRP:
                return "ABBCCD"+ Constants.bedId+"00032B0F000F0000000F000F00000000000000";



            // 发送自由调整上升指令(头板)
            case ControlBedConstants.CONTROL_POST_HEAD_UP:
                return "ABBCCD"+ Constants.zgbId+"0004B1C1000000000000000000000000000000";
            case ControlBedConstants.RETURN_POST_HEAD_UP:
                return "ABBCCD"+ Constants.bedId+"0004B1C1000000000000000000000000000000";

            // 发送自由调整下降指令(头板)
            case ControlBedConstants.CONTROL_POST_HEAD_DOWN:
                return "ABBCCD"+ Constants.zgbId+"0004B1C2000000000000000000000000000000";
            case ControlBedConstants.RETURN_POST_HEAD_DOWN:
                return "ABBCCD"+ Constants.bedId+"0004B1C2000000000000000000000000000000";

            // 发送自由调整上升指令(腿板)
            case ControlBedConstants.CONTROL_POST_LEG_UP:
                return "ABBCCD"+ Constants.zgbId+"0004B2C1000000000000000000000000000000";

            case ControlBedConstants.RETURN_POST_LEG_UP:
                return "ABBCCD"+ Constants.bedId+"0004B2C1000000000000000000000000000000";

            // 发送自由调整下降指令(腿板)
            case ControlBedConstants.CONTROL_POST_LEG_DOWN:
                return "ABBCCD"+ Constants.zgbId+"0004B2C2000000000000000000000000000000";
            case ControlBedConstants.RETURN_POST_LEG_DOWN:
                return "ABBCCD"+ Constants.bedId+"0004B2C2000000000000000000000000000000";

            // 发送自由调整上升指令(头腿板整体)
            case ControlBedConstants.CONTROL_POST_BODY_UP:
                return "ABBCCD"+ Constants.zgbId+"0004B3C1000000000000000000000000000000";
            case ControlBedConstants.RETURN_POST_BODY_UP:
                return "ABBCCD"+ Constants.bedId+"0004B2C2000000000000000000000000000000";

            // 发送自由调整下降指令(头腿板整体)
            case ControlBedConstants.CONTROL_POST_BODY_DOWN:
                return "ABBCCD"+ Constants.zgbId+"0004B3C2000000000000000000000000000000";
            case ControlBedConstants.RETURN_POST_BODY_DOWN:
                return "ABBCCD"+ Constants.bedId+"0004B3C2000000000000000000000000000000";

            // 发送整床指令升高(实际床高度身高)
            case ControlBedConstants.CONTROL_NURSE_STATURE_UP:
                return "ABBCCD"+ Constants.zgbId+"0004B4C1500000000000000000000000000000";
            case ControlBedConstants.RETURN_NURSE_STATURE_UP:
                return "ABBCCD"+ Constants.bedId+"0004B4C1500000000000000000000000000000";

            // 发送整床指令下降(实际床高度身高)
            case ControlBedConstants.CONTROL_NURSE_STATURE_DOWN:
                return "ABBCCD"+ Constants.zgbId+"0004B4C2500000000000000000000000000000";
            case ControlBedConstants.RETURN_NURSE_STATURE_DOWN:
                return "ABBCCD"+ Constants.bedId+"0004B4C1500000000000000000000000000000";

            // 发送整床指令(实际床高度身高)
            case ControlBedConstants.CONTROL_NURSE_STATURE_CHANGE:
                return "ABBCCD"+ Constants.zgbId+"0004B4C0";
            case ControlBedConstants.RETURN_NURSE_STATURE_CHANGE:
                return "ABBCCD"+ Constants.bedId+"0004B4C0";

            // 整床倾斜角度(暂不响应降)
            case ControlBedConstants.CONTROL_SLANT_ANGLE:
                return "ABBCCD"+ Constants.zgbId+"0004B5C10F0000000000000000000000000000";
            case ControlBedConstants.RETURN_SLANT_ANGLE:
                return "ABBCCD"+ Constants.bedId+"0004B5C10F0000000000000000000000000000";

            // 发送自由调整结束指令
            case ControlBedConstants.CONTROL_POST_FINISH:
                return "ABBCCD"+ Constants.zgbId+"00050000000000000000000000000000000000";
            case ControlBedConstants.RETURN_POST_FINISH:
                return "ABBCCD"+ Constants.bedId+"03E80B14000000000014000000000000000000";




            //======================与护士站交互指令==================
            //发出通知
            //登录通知指令
            case ControlBedConstants.RETURN_NURSE_LOGIN_USER:
                return "ABBCCD"+ Constants.nurseId+"00C0000000000000001D000000000000000000";
            // 换药指令
            case ControlBedConstants.CONTROL_NURSE_MEDICINE:
                return "ABBCCD"+ Constants.nurseId+"00011200000000000000000000000000000000";
            // 打针指令
            case ControlBedConstants.CONTROL_NURSE_INJECT:
                return "ABBCCD"+ Constants.nurseId+"00021200000000000000000000000000000000";
            // 上厕所指令
            case ControlBedConstants.CONTROL_NURSE_WC:
                return "ABBCCD"+ Constants.nurseId+"00021300000000000000000000000000000000";
            // 其它指令
            case ControlBedConstants.CONTROL_NURSE_OTHER:
                return "abbccd"+ Constants.nurseId+"00021400000000000000000000000000000000";

            //接收通知

            // 护士站对床加锁
            case ControlBedConstants.CONTROL_NURSE_LOCK:
                return "ABBCCD0100000001C20000000000000000000000000000";
            // 护士站对床解锁
            case ControlBedConstants.CONTROL_NURSE_UNLOCK:
                return "ABBCCD0100000001C80000000000000000000000000000";

            //==========================刷卡指令（从护士站接收）============================

            // 接收到用户1刷卡数据 9462757390460886
            case ControlBedConstants.RECEIVE_REGISTER_USER_ONE:
                return "ABBCCD"+Constants.bedId+"00B00904060207050703090004060008080600";
            // 返回用户1刷卡数据
            case ControlBedConstants.RETURN_REGISTER_USER_ONE:
                return "ABBCCD"+Constants.nurseId+"A0B00904060207050703090004060008080600";

            // 用户2刷卡 2307400022479255
            case ControlBedConstants.RECEIVE_REGISTER_USER_TWO:
                return "ABBCCD"+Constants.bedId+"00B00203000704000000030304070902050500";
            // 返回用户2刷卡数据
            case ControlBedConstants.RETURN_REGISTER_USER_TWO:
                return "ABBCCD"+Constants.nurseId+"A0B00203000704000000030304070902050500";

            // 用户3刷卡 4574759635022162
            case ControlBedConstants.RECEIVE_REGISTER_USER_THREE:
                return "ABBCCD"+Constants.bedId+"00B00405070407050906030500020201060200";
            // 返回用户3刷卡数据
            case ControlBedConstants.RETURN_REGISTER_USER_THREE:
                return "ABBCCD"+Constants.nurseId+"A0B00405070407050906030500020201060200";

            // 用户4刷卡 2122488242411351
            case ControlBedConstants.RECEIVE_REGISTER_USER_FOUR:
                return "ABBCCD"+Constants.bedId+"00B00201020204080802040204010103050100";
            // 返回用户4刷卡数据
            case ControlBedConstants.RETURN_REGISTER_USER_FOUR:
                return "ABBCCD"+Constants.nurseId+"A0B00201020204080802040204010103050100";

            // 用户5刷卡 2694809122197893
            case ControlBedConstants.RECEIVE_REGISTER_USER_FIVE:
                return "ABBCCD"+Constants.bedId+"00B00206090408000901020201090708090300";
            // 返回用户5刷卡数据
            case ControlBedConstants.RETURN_REGISTER_USER_FIVE:
                return "ABBCCD"+Constants.nurseId+"A0B00206090408000901020201090708090300";

            // 用户6刷卡 3890208385899636
            case ControlBedConstants.RECEIVE_REGISTER_USER_SIX:
                return "ABBCCD"+Constants.bedId+"00B00308090002000803080508090906030600";
            // 返回用户6刷卡数据
            case ControlBedConstants.RETURN_REGISTER_USER_SIX:
                return "ABBCCD"+Constants.nurseId+"A0B00308090002000803080508090906030600";
            //==============单片机请求指令==========================

            //接收生命体征参数指令
            case ControlBedConstants.RECEIVE_ZGB_BODYSIGN:
                return "ABBCCD"+Constants.bedId+"00214A0E00000000002C000000000000000000";
            //返回生命体征参数指令
            case ControlBedConstants.RETURN_ZGB_BODYSIGN:
                return "ABBCCD"+Constants.zgbId+"A0214A0E00000000002C000000000000000000";
            //床体运动完成后接收的参数指令
            case ControlBedConstants.RECEIVE_ZGB_BEDCOMPLETE:
                return "ABBCCD"+Constants.bedId+"00214A0E00000000002C000000000000000000";
            //返回床体运动完成指令
            case ControlBedConstants.RETURN_ZGB_BEDCOMPLETE:
                return "ABBCCD"+Constants.zgbId+"A0214A0E00000000002C000000000000000000";
            default:
                return "";

        }
    }
}
